package dptest;

public class t55 {

	public static void main(String[] args) {
		int nums [] = {2,3,1,1,4};
		boolean dp [] = new boolean[nums.length];
		dp[0] = true;
		for(int i = 1; i<nums.length; i++) {
			dp[i] = false;
			for(int j = 0; j<i;j++) {
				if(i-j<=nums[j] && dp[i-1]) {
					dp[i] = true;
					break;
				}
			}
		}
		//return dp[nums.length];
		System.out.print(dp[nums.length-1]);

	}

}
